#pragma once

class CMouse final :
	public IInput,
	public IEngMod
{
public:
	CMouse();
	~CMouse();

	/*-IInput-------------------------------------------------------------------*/
	virtual bool GetKeyState(uint keyToCheck) const override;
	virtual void SetKeyState(uint keyToCheck, bool state) override;
	virtual void OnUpdate() override;

	/*-EngMod-------------------------------------------------------------------*/
	virtual void OnLoop(uint i) override;

	/*--------------------------------------------------------------------------*/

	const glm::vec2& GetPosition() const;
	const glm::vec2& GetMovement() const;
	const glm::vec2& GetDirection() const;

	void SetCursor(const glm::vec2& npos = glm::vec2());

private:
	glm::vec2 m_position;
	glm::vec2 m_movement;
	glm::vec2 m_direction;

	bool m_leftButton;
	bool m_rightButton;
	bool m_wheelUp;
	bool m_wheelDown;

	Variable* var_mouse_speed;
	Variable* var_mouse_wrap;
};

extern CMouse* g_Mouse;